package com.st.buy.manager.controller;

import com.st.buy.manager.service.ItemCatService;
import com.st.buy.util.pojo.EasyUITreeNode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 张双虎
 */
@RestController
public class ItemCatController {

    @Autowired
    private ItemCatService itemCatService;

    @RequestMapping("/item/cat/list")
    public List<EasyUITreeNode> queryItemCats(@RequestParam(defaultValue = "0",value = "id") long parentId){
        return  itemCatService.queryCatByParentId(parentId);
    }
}
